﻿<div>
    @foreach (var d in UploadingList)
    {
        <MCard Class="upload-list">
            <div>@d.FileName</div>
            @if (d.Stats == UpdateStats.BeUploading)
            {

                <MContainer>
                    <div>
                        <span>@(CommonHelper.GetFileSize(d.UploadingSize)+"/"+CommonHelper.GetFileSize(d.Length))</span>
                        <span style="float: right;">@(CommonHelper.GetFileSize(d.Rate) + "/s")</span>
                    </div>
                    <MProgressLinear Value="@(d.Progress)" Height="25">
                        <span>@(d.Progress)%</span>
                    </MProgressLinear>
                </MContainer>
            }
            else if (d.Stats == UpdateStats.Failure)
            {

                <MContainer>
                    上传失败
                </MContainer>
            }
            else if (d.Stats == UpdateStats.Succeed)
            {
                <MContainer>
                    上传完成
                </MContainer>
            }
            else
            {
                <MContainer>
                    未知状态
                </MContainer>
            }
            @if (d.Stats == UpdateStats.BeUploading || d.Stats == UpdateStats.Suspend)
            {
                <div>
                    @if (d.Stats == UpdateStats.Suspend)
                    {
                        <MButton>暂停</MButton>
                    }
                    else
                    {
                        <MButton>继续</MButton>
                    }
                    <MButton>取消</MButton>
                </div>
            }
        </MCard>
    }
</div>


<style>
    .upload-list {
        transition: .3s;
        margin: 5px;
        padding: 5px;
        border-radius: 10px;
    }

        .upload-list:hover {
            transition: .3s;
            background-color: #FFD700;
        }
</style>